package com.lx.information.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.lx.information.mapper.InformationCaseMapper;
import com.lx.information.domain.InformationCase;
import com.lx.information.service.IInformationCaseService;

/**
 * 案件Service业务层处理
 *
 * @author lx
 * @date 2023-04-03
 */
@Service
public class InformationCaseServiceImpl implements IInformationCaseService
{
    @Autowired
    private InformationCaseMapper informationCaseMapper;

    /**
     * 查询案件
     *
     * @param id 案件主键
     * @return 案件
     */
    @Override
    public InformationCase selectInformationCaseById(Long id)
    {
        return informationCaseMapper.selectInformationCaseById(id);
    }

    /**
     * 查询案件列表
     *
     * @param informationCase 案件
     * @return 案件
     */
    @Override
    public List<InformationCase> selectInformationCaseList(InformationCase informationCase)
    {
        return informationCaseMapper.selectInformationCaseList(informationCase);
    }

    /**
     * 新增案件
     *
     * @param informationCase 案件
     * @return 结果
     */
    @Override
    public int insertInformationCase(InformationCase informationCase)
    {
        informationCase.setCreateTime(DateUtils.getNowDate());
        return informationCaseMapper.insertInformationCase(informationCase);
    }

    /**
     * 修改案件
     *
     * @param informationCase 案件
     * @return 结果
     */
    @Override
    public int updateInformationCase(InformationCase informationCase)
    {
        informationCase.setUpdateTime(DateUtils.getNowDate());
        return informationCaseMapper.updateInformationCase(informationCase);
    }

    /**
     * 批量删除案件
     *
     * @param ids 需要删除的案件主键
     * @return 结果
     */
    @Override
    public int deleteInformationCaseByIds(Long[] ids)
    {
        return informationCaseMapper.deleteInformationCaseByIds(ids);
    }

    /**
     * 删除案件信息
     *
     * @param id 案件主键
     * @return 结果
     */
    @Override
    public int deleteInformationCaseById(Long id)
    {
        return informationCaseMapper.deleteInformationCaseById(id);
    }

    @Override
    public InformationCase selectInformationCaseByBidAndCaseNo(Long bid, String caseNo) {
        return informationCaseMapper.selectInformationCaseByBidAndCaseNo(bid, caseNo);
    }
}
